package com.santu.edu.supporter.biz.order.dao.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.santu.edu.supporter.biz.order.pojo.po.OrderPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author npc234
 * @description 针对表【day_day_up_order】的数据库操作Mapper
 * @createDate 2024-03-18 16:25:15
 * @Entity com.santu.edu.supporter.biz.order.dao.po.Order
 */
@Mapper
public interface OrderMapper {

    /**
     * @param item
     * @description 添加一条记录
     */
    void addOrder(@Param("item") OrderPO item);

    /**
     *修改订单地址
     * @param orderId 订单id
     * @param addressId 地址id
     */
    void updateOrderAddress(@Param("orderId") String orderId, @Param("addressId") String addressId);

    /**
     * 删除订单
     * @param orderId
     */
    void removeOrder(@Param("orderId") String orderId);

    /**
     * 根据用户id和订单状态查询订单
     * @param userId
     * @param orderStatus
     * @param objectPage
     * @return
     */
    Page<OrderPO> selectOrderPage(@Param("userId") String userId,@Param("orderStatus") Integer orderStatus, Page<OrderPO> objectPage);

    /**
     * 修改订单状态
     * @param orderId
     * @param newStatus
     * @param oldStatus
     */
    void updateOrderStatus(@Param("orderId") String orderId,@Param("newStatus") Integer newStatus,@Param("oldStatus") Integer oldStatus);

    /**
     * 根据订单id查询订单
     * @param orderId
     * @return
     */
    OrderPO selectOrderById(@Param("orderId") String orderId);

}




